package classLoading.clinit;

class SuperClass {
    protected static int v = 1;
    static {
        v = 2;
        System.out.println("super init");
    }
}

class SubClass extends SuperClass {
    protected static int b = v;
    static {
        System.out.println("sub init");
    }
}

/**
 * 父类的clinit会比子类先执行
 */
public class Demo2 {
    public static void main(String[] args) {
        System.out.println(SubClass.b);
    }
}
